/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author 王宇
* @date 2023-12-29
**/
@Entity
@Data
@Table(name="dis_change_apply")
public class DisChangeApply implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "apply_id")
    @ApiModelProperty(value = "主键ID")
    private Long applyId;

    @Column(name = "apply_type")
    @ApiModelProperty(value = "申请类型")
    private Integer applyType;

    @Column(name = "apply_type_desc")
    @ApiModelProperty(value = "申请类型描述")
    private String applyTypeDesc;

    @Column(name = "apply_user")
    @ApiModelProperty(value = "申请人")
    private String applyUser;

    @Column(name = "create_time")
    @ApiModelProperty(value = "提交时间")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "update_user")
    @ApiModelProperty(value = "更新人")
    private String updateUser;

    @Column(name = "apply_status")
    @ApiModelProperty(value = "申请状态，0：提交申请，1：成功，2：失败")
    private Integer applyStatus;

    @Column(name = "refuse_msg")
    @ApiModelProperty(value = "拒绝原因")
    private String refuseMsg;

    @Column(name = "mirror_image")
    @ApiModelProperty(value = "镜像")
    private String mirrorImage;

    @Column(name = "apply_content")
    @ApiModelProperty(value = "申请内容")
    private String applyContent;

    public void copy(DisChangeApply source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}